Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix level-loading crashes #418

Merged
merged 1 commit into from
Aug 9, 2024
Merged

fix level-loading crashes #418

merged 1 commit into from
Aug 9, 2024

Conversation

tra
Copy link
Contributor

@tra tra commented Aug 9, 2024

When new levels are loaded the Hull and Level/Set menus are re-created from scratch. This would leave dangling pointers in nanogui::Screen (mDragWidget and mFocusPath). The "best" fix would probably be to replace all Widget pointers with shared_ptr<Widget>. But this is a quick fix that gets the job done.

I also added /dbg rload X which will load a new level every X seconds. This was useful for recreating this bug but also might be useful for discovering other random level-load issues in the future so I left it in.

When new levels are loaded the Hull and Level/Set menus are re-created from scratch.  This would leave dangling pointers in nanogui::Screen (mDragWidget and mFocusPath).  The "best" fix would probably be to replace all Widget pointers with shared_ptr<Widget>.  But this is a quick fix that gets the job done.

I also added "/dbg rload X" which will load a new level every X seconds.  This was useful for recreating this bug but also might be useful for discovering other random level-load issues in the future so I left it in.
@tra tra merged commit bdf16c9 into main Aug 9, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant